# Contributor: Michael Lyngbol <michael@lyngbol.dk>
# Maintainer: Michael Lyngbol <michael@lyngbol.dk>
pkgname=inetutils-telnet
_pkgname=inetutils
pkgver=2.2
pkgrel=1
pkgdesc="Telnet client from GNU network utilities"
url="https://www.gnu.org/software/inetutils"
arch="all"
license="GPL-3.0-or-later"
depends="ncurses"
makedepends="ncurses-dev"
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/inetutils/$_pkgname-$pkgver.tar.xz
	0001-telnet-fix-infloop-for-malicious-server.patch
	"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libexec=/usr/sbin \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-clients \
		--disable-servers \
		--enable-telnet
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	# remove empty directories
	rm -rf "$pkgdir"/usr/sbin \
		"$pkgdir"/usr/share/man/man8
}

sha512sums="
153bc02b2d497f927528f9aac04f16011ec5eb54a3acd98c100dfb6b0b01a63fd1cbc7d2e502b434e38d3ef70208d7a498141b930b1818181343627a525eaeef  inetutils-2.2.tar.xz
844cac3437d8b1321e90dadbcbd2020a675740b4d3a051b17508a42196e5814e692dbee2cf41c30c1549746e497127261a5f76a86b914d83f83ea46dc15c9143  0001-telnet-fix-infloop-for-malicious-server.patch
"
